package com.ng.desktop.hr.view;

import java.awt.Container;
import java.awt.Frame;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JLabel;

import com.ng.framework.view.desktop.NGGUIUtils;

public class AyudaDialog extends JDialog implements ActionListener {

	private static final long serialVersionUID = -6925976238310605248L;
	
	private JButton volverButton;
	
	public AyudaDialog(Frame owner) {
		super(owner, true);
		
		this.initComponents();
		
		this.buildGui();
		
		this.setTitle("Acerca de...");
		
		this.setSize(600, 150);
		this.setLocationRelativeTo(owner);
	}
	
	private void initComponents() {
		this.volverButton = NGGUIUtils.createTextButton("Volver", this);
	}
	
	private void buildGui() {
		Container contentPane = this.getContentPane();
		
		contentPane.setLayout(new GridBagLayout());
		
		contentPane.add(new JLabel("Ante cualquier duda o consulta por favor contactarnos a través de los medios de comunicación abajo mencionados."), new GridBagConstraints(0, 0, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
		contentPane.add(new JLabel("<html>Website:<font color=\"#0000CF\"><u><a href=\"http://www.nissigroup.com.ar\">http://www.nissigroup.com.ar</a></u></font></html>"), new GridBagConstraints(0, 1, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 5, 5, 5), 0, 0));
		contentPane.add(new JLabel("Email: software@nissigroup.com.ar"), new GridBagConstraints(0, 2, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 5, 5, 5), 0, 0));
		contentPane.add(new JLabel("Teléfono: (+54) 3516-650948"), new GridBagConstraints(0, 3, 1, 1, 1, 1, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, new Insets(0, 5, 5, 5), 0, 0));
		contentPane.add(volverButton, new GridBagConstraints(0, 4, 1, 1, 1, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0));
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		if(e.getSource() == volverButton) {
			this.dispose();
		}
	}

}
